home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 100 / CD-ROM 100.iso / aplic / oo1_1 / f_0328 / scalc.jar / text / scalc / guide / cellstyle_conditional.xml < prev    next >
Encoding:
Extensible Markup Language  |  2003-04-30  |  11.0 KB  |  117 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Applying Conditional Formatting</title><meta name="filename" content="text/scalc/guide/cellstyle_conditional"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         p.P3{
  9.                 }
  10.         p.P4{
  11.                 }
  12.         p.P5{
  13.                 }
  14.         p.P6{
  15.                 }
  16.         p.P7{
  17.                 }
  18.         span.T1{
  19.                 font-weight:bold;}
  20.         </style></head><body>
  21.   
  22.   
  23.   <p class="P1"/>
  24.   <p class="Head1"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="formats; use conditional formats" tag="kw68151_1" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="conditional formatting; cells" tag="kw68151_8" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="cells; conditional formatting" tag="kw68151_7" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="formatting; conditional formatting" tag="kw68151_6" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="cellstyle_conditional" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68151">Applying Conditional Formatting</help:link></help:to-be-embedded></p>
  25.   <p class="Paragraph"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/>Using the menu command <span class="T1">Format - Conditional formatting</span>, the dialog allows you to define up to three conditions per cell, which must be met in order for the selected cells to have a particular format.</p>
  26.   <p class="Paragraph"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/>With conditional formatting, you can, for example, highlight the totals that exceed the average value of all totals. If the totals change, the formatting changes correspondingly, without having to apply other styles manually.</p>
  27.   <ol class="L1">
  28.    <li class="">
  29.     <p class="P2"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/>Select the cells to which you want to apply a conditional style.</p>
  30.    </li>
  31.    <li class="">
  32.     <p class="P2"><help:paragraphinfo state="U" number="28" xmlns:help="http://openoffice.org/2000/help"/>Choose <span class="T1">Format - Conditional Formatting</span>.</p>
  33.    </li>
  34.    <li class="">
  35.     <p class="P2"><help:paragraphinfo state="U" number="29" xmlns:help="http://openoffice.org/2000/help"/>Enter the condition(s) into the dialog box. The dialog is described in detail in <help:link Id="66890" xmlns:help="http://openoffice.org/2000/help"><help:productname>%PRODUCTNAME</help:productname> Help</help:link>, and an example is provided below:</p>
  36.    </li>
  37.   </ol>
  38.   <p class="Head2"><help:paragraphinfo state="U" number="38" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="random numbers; generating" tag="kw68151_5" xmlns:help="http://openoffice.org/2000/help"/>Example of Conditional Formatting: Generate Number Values</p>
  39.   <p class="Paragraph"><help:paragraphinfo state="U" number="39" xmlns:help="http://openoffice.org/2000/help"/>You want to give certain values in your tables particular emphasis. For example, in a table of turnovers, you can show all the values above the average in green and all those below the average in red. This is possible with conditional formatting.</p>
  40.   <ol class="L2">
  41.    <li class="">
  42.     <p class="P3"><help:paragraphinfo state="U" number="40" xmlns:help="http://openoffice.org/2000/help"/>First of all, write a table in which a few different values occur. For your test you can create tables with any random numbers:</p>
  43.     <p class="P3"><help:paragraphinfo state="U" number="41" xmlns:help="http://openoffice.org/2000/help"/>In one of the cells enter the formula =RAND(), and you will obtain a random number between 0 and 1. If you want integers of between 0 and 50, enter the formula =INT(RAND()*50).</p>
  44.    </li>
  45.    <li class="">
  46.     <p class="P3"><help:paragraphinfo state="U" number="42" xmlns:help="http://openoffice.org/2000/help"/>Copy the formula to create a row of random numbers. Click the bottom right corner of the selected cell, and drag to the right until the desired cell range is selected.</p>
  47.    </li>
  48.    <li class="">
  49.     <p class="P3"><help:paragraphinfo state="U" number="43" xmlns:help="http://openoffice.org/2000/help"/>In the same way as described above, drag down the corner of the rightmost cell in order to create more rows of random numbers.</p>
  50.    </li>
  51.   </ol>
  52.   <p class="Head2"><help:paragraphinfo state="U" number="44" xmlns:help="http://openoffice.org/2000/help"/>Example of Conditional Formatting: Define Cell Styles</p>
  53.   <p class="Paragraph"><help:paragraphinfo state="U" number="45" xmlns:help="http://openoffice.org/2000/help"/>The next step is to apply a cell style to all values that represent above-average turnover, and one to those that are below the average. Ensure that the Stylist is visible before proceeding.</p>
  54.   <ol class="L3">
  55.    <li class="">
  56.     <p class="P4"><help:paragraphinfo state="U" number="46" xmlns:help="http://openoffice.org/2000/help"/>Click in a blank cell and select the command <span class="T1">Format Cells</span> in the context menu.</p>
  57.    </li>
  58.    <li class="">
  59.     <p class="P4"><help:paragraphinfo state="U" number="47" xmlns:help="http://openoffice.org/2000/help"/>In the <span class="T1">Format Cells</span> dialog on the <span class="T1">Background</span> tab, select a background color. Click OK.</p>
  60.    </li>
  61.    <li class="">
  62.     <p class="P4"><help:paragraphinfo state="U" number="48" xmlns:help="http://openoffice.org/2000/help"/>In the Stylist, click the <span class="T1">New Style from Selection</span> icon. Enter the name of the new style. For this example, name the style "Above".</p>
  63.    </li>
  64.    <li class="">
  65.     <p class="P4"><help:paragraphinfo state="U" number="49" xmlns:help="http://openoffice.org/2000/help"/>To define a second style, click again in a blank cell and proceed as described above. Assign a different background color for the cell and assign a name (for this example, "Below").</p>
  66.    </li>
  67.   </ol>
  68.   <p class="Head2"><help:paragraphinfo state="U" number="60" xmlns:help="http://openoffice.org/2000/help"/>Example of Conditional Formatting: Calculate Average</p>
  69.   <p class="Paragraph"><help:paragraphinfo state="U" number="51" xmlns:help="http://openoffice.org/2000/help"/>In our particular example, we are calculating the average of the random values. The result is placed in a cell:</p>
  70.   <ol class="L4">
  71.    <li class="">
  72.     <p class="P5"><help:paragraphinfo state="U" number="52" xmlns:help="http://openoffice.org/2000/help"/>Set the cursor in a blank cell, for example, J14, and activate the Function Autopilot.</p>
  73.    </li>
  74.    <li class="">
  75.     <p class="P5"><help:paragraphinfo state="U" number="53" xmlns:help="http://openoffice.org/2000/help"/>Select the AVERAGE function. Use the mouse to select all your random numbers. If you cannot see the entire range, because AutoPilot: Functions is obscuring it, you can temporarily zoom out from the dialog using the <help:popup Id="65630" Eid="eingabesymbol" xmlns:help="http://openoffice.org/2000/help">Zoom in/out key</help:popup>.</p>
  76.    </li>
  77.    <li class="">
  78.     <p class="P5"><help:paragraphinfo state="U" number="54" xmlns:help="http://openoffice.org/2000/help"/>Close AutoPilot: Functions with OK.</p>
  79.    </li>
  80.   </ol>
  81.   <p class="Head2"><help:paragraphinfo state="U" number="50" xmlns:help="http://openoffice.org/2000/help"/>Example of Conditional Formatting: Apply Cell Style</p>
  82.   <p class="Paragraph"><help:paragraphinfo state="U" number="55" xmlns:help="http://openoffice.org/2000/help"/>Now you can apply the conditional formatting to the sheet:</p>
  83.   <ol class="L5">
  84.    <li class="">
  85.     <p class="P6"><help:paragraphinfo state="U" number="56" xmlns:help="http://openoffice.org/2000/help"/>Select all cells with the random numbers.</p>
  86.    </li>
  87.    <li class="">
  88.     <p class="P6"><help:paragraphinfo state="U" number="57" xmlns:help="http://openoffice.org/2000/help"/>Choose the <span class="T1">Format - Conditional Formatting</span> command to open the corresponding dialog.</p>
  89.    </li>
  90.    <li class="">
  91.     <p class="P6"><help:paragraphinfo state="U" number="58" xmlns:help="http://openoffice.org/2000/help"/>Define the condition as follows: If cell value is less than J14, format with cell style "Below", and if cell value is greater than or equal to J14, format with cell style "Above".</p>
  92.    </li>
  93.   </ol>
  94.   <p class="Head2"><help:paragraphinfo state="U" number="61" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="cell styles; copying" tag="kw68151_4" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="copying; cell styles" tag="kw68151_3" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="tables; copying cell styles" tag="kw68151_2" xmlns:help="http://openoffice.org/2000/help"/>Example of Conditional Formatting: Copy Cell Style</p>
  95.   <p class="Paragraph"><help:paragraphinfo state="U" number="62" xmlns:help="http://openoffice.org/2000/help"/>To apply the conditional formatting to other cells later:</p>
  96.   <ol class="L6">
  97.    <li class="">
  98.     <p class="P7"><help:paragraphinfo state="U" number="63" xmlns:help="http://openoffice.org/2000/help"/>Click one of the cells that has been assigned conditional formatting.</p>
  99.    </li>
  100.    <li class="">
  101.     <p class="P7"><help:paragraphinfo state="U" number="64" xmlns:help="http://openoffice.org/2000/help"/>Copy the cell to the clipboard.</p>
  102.    </li>
  103.    <li class="">
  104.     <p class="P7"><help:paragraphinfo state="U" number="65" xmlns:help="http://openoffice.org/2000/help"/>Select the cells that are to receive this same formatting.</p>
  105.    </li>
  106.    <li class="">
  107.     <p class="P7"><help:paragraphinfo state="U" number="66" xmlns:help="http://openoffice.org/2000/help"/>Choose <span class="T1">Edit - Paste Special</span>. The <span class="T1">Paste Special</span> dialog appears.</p>
  108.    </li>
  109.    <li class="">
  110.     <p class="P7"><help:paragraphinfo state="U" number="67" xmlns:help="http://openoffice.org/2000/help"/>In the <span class="T1">Selection</span> area, check only the <span class="T1">Formats</span> box. All other boxes must be unchecked. Click OK.</p>
  111.    </li>
  112.   </ol>
  113.   <p class="ParaList"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="65598" Eid="related" xmlns:help="http://openoffice.org/2000/help"/></p>
  114.   <p class="ParaList"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="68149" Eid="cellstyle_by_formula" xmlns:help="http://openoffice.org/2000/help"/></p>
  115.   <p class="ParaList"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="68152" Eid="cellstyle_minusvalue" xmlns:help="http://openoffice.org/2000/help"/></p>
  116.   <p class="ParaList"><help:paragraphinfo state="U" number="68" xmlns:help="http://openoffice.org/2000/help"/><help:link Id="66890" xmlns:help="http://openoffice.org/2000/help">Format - Conditional formatting</help:link></p>
  117.  </body></html>